/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dw2.vista;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author sistemas
 */
@ManagedBean //crea el managent bean
@SessionScoped
public class AccesBean {
private String user;
private String pass;

    /**
     * Creates a new instance of AccederBean
     */
    public AccesBean() { //Construcyor vacio
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public String procesarAccion(){
        
        if(user.equals("root")&& pass.equals("12345")){
          FacesContext context=FacesContext.getCurrentInstance();
          context.getExternalContext().getSessionMap().put("USUARIO_LOGUEADO",user);
            return"MenuPrincipal";
       
        }else{
            return "pagina 2";
        }
        }
     
}
